package com.lyh.yobeiapplication.helper;

import android.app.Activity;
import android.widget.Toast;

public class ToastHelper {

    public static void showToast(final Activity activity, final int resId) {
        if (activity == null) {
            return;
        }
        activity.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(activity, resId, Toast.LENGTH_SHORT).show();
            }
        });
    }

    public static void showToast(final Activity activity, final String message) {
        if (activity == null) {
            return;
        }
        activity.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(activity, message, Toast.LENGTH_SHORT).show();
            }
        });
    }
}
